﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MadeInPortugalWebApplication
{
    public partial class AdminProductList : System.Web.UI.Page
    {
        int UserId = 0;
        String UserType;

        protected override void OnInit(EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["UserType"] == null)
                    Response.Redirect("index.aspx");
                if (Session["UserId"] == null)
                    Response.Redirect("index.aspx");
                UserType = Session["UserType"].ToString();
                int.TryParse(Session["UserId"].ToString(), out UserId);
                if(UserType!="Admin")
                    Response.Redirect("index.aspx");
            }
        }
    }
}